package org.xhnews.utils;

import net.rim.device.api.system.GPRSInfo;
import net.rim.device.api.system.IDENInfo;

public class DeviceUtil {
	public static String getPhoneIMEI() {
		StringBuffer imei = new StringBuffer();

		boolean success = true;
		try {
			imei.append(IDENInfo.imeiToString(IDENInfo.getIMEI()));
		} catch (Exception e) {
			success = false;
			System.err.println(e.toString());
		}

		if (!success) {
			try {
				imei.append(GPRSInfo.imeisvToString(GPRSInfo.getIMEI(), false));
			} catch (Exception e) {
				System.err.println(e.toString());
			}
		}

		return imei.toString();
	}
}
